package cn.com.guage.dtm.mapping.service.impl;

import java.util.List;
import cn.com.guage.dtm.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.com.guage.dtm.mapping.mapper.MappingFieldInfoMapper;
import cn.com.guage.dtm.mapping.domain.MappingFieldInfo;
import cn.com.guage.dtm.mapping.service.IMappingFieldInfoService;
import cn.com.guage.dtm.common.core.text.Convert;

/**
 * 字段级映射信息Service业务层处理
 * 
 * @author liujun
 * @date 2021-07-14
 */
@Service
public class MappingFieldInfoServiceImpl implements IMappingFieldInfoService 
{
    @Autowired
    private MappingFieldInfoMapper mappingFieldInfoMapper;

    /**
     * 查询字段级映射信息
     * 
     * @param fieldId 字段级映射信息ID
     * @return 字段级映射信息
     */
    @Override
    public MappingFieldInfo selectMappingFieldInfoById(Long fieldId)
    {
        return mappingFieldInfoMapper.selectMappingFieldInfoById(fieldId);
    }

    /**
     * 查询字段级映射信息列表
     * 
     * @param mappingFieldInfo 字段级映射信息
     * @return 字段级映射信息
     */
    @Override
    public List<MappingFieldInfo> selectMappingFieldInfoList(MappingFieldInfo mappingFieldInfo)
    {
        return mappingFieldInfoMapper.selectMappingFieldInfoList(mappingFieldInfo);
    }

    /**
     * 新增字段级映射信息
     * 
     * @param mappingFieldInfo 字段级映射信息
     * @return 结果
     */
    @Override
    public int insertMappingFieldInfo(MappingFieldInfo mappingFieldInfo)
    {
        mappingFieldInfo.setCreateTime(DateUtils.getNowDate());
        return mappingFieldInfoMapper.insertMappingFieldInfo(mappingFieldInfo);
    }

    /**
     * 修改字段级映射信息
     * 
     * @param mappingFieldInfo 字段级映射信息
     * @return 结果
     */
    @Override
    public int updateMappingFieldInfo(MappingFieldInfo mappingFieldInfo)
    {
        mappingFieldInfo.setUpdateTime(DateUtils.getNowDate());
        return mappingFieldInfoMapper.updateMappingFieldInfo(mappingFieldInfo);
    }

    /**
     * 删除字段级映射信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteMappingFieldInfoByIds(String ids)
    {
        return mappingFieldInfoMapper.deleteMappingFieldInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除字段级映射信息信息
     * 
     * @param fieldId 字段级映射信息ID
     * @return 结果
     */
    @Override
    public int deleteMappingFieldInfoById(Long fieldId)
    {
        return mappingFieldInfoMapper.deleteMappingFieldInfoById(fieldId);
    }
}
